<?php
session_start();
error_reporting(E_ALL ^ E_WARNING ^E_NOTICE);
 echo"<head>
        <link rel='Stylesheet' type='text/css' href='style.css' />
        <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
        <title></title>
    </head>"; 
include 'functions.php';
connect();
select_db('kapek');
if ($_GET['status']==zlecone)
{
$data="0000-00-00";
}
if ($_GET['status']==gotowe)
    {
    $data=$_GET['data'];
    }
else $data=date("Y-m-d");

echo $_GET['kod'];
echo $_GET['status'];
echo $data;

$pytaj='UPDATE orders SET status="'.$_GET['status'].'",senddate="'.$data.'" WHERE kod="'.$_GET['kod'].'"';
$result=mysql_query($pytaj) or die (" nie ma tabeli: ".mysql_error());

$skad=$_SERVER["HTTP_REFERER"];
header('location:'.$skad.''); //to redirect back to "index.php" after logging out
exit();
?>
